package org.example.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
//import com.sun.org.apache.xpath.internal.objects.XString;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@TableName("questions")
public class QuestionInfoEntity {
    @TableId(type= IdType.AUTO)
    private Integer questionId;
    private Integer examId;
    private String content;
    private Byte questionDifficulty;
    private String questionType;
    private String options;
    private String contentAnswer;
    private float score;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
    private String knowledgePoint;
    private String subject;

    public QuestionInfoEntity() {
        // 无参构造函数，供 MyBatis 实例化使用
    }

    // 带参数的构造方法
    public QuestionInfoEntity(Integer questionId, Integer examId, String content, Byte questionDifficulty, String questionType,
                              String options, String contentAnswer, float score, LocalDateTime createTime, LocalDateTime updateTime,
                              String knowledgePoint, String subject) {
        this.questionId = questionId;
        this.examId = examId;
        this.content = content;
        this.questionDifficulty = questionDifficulty;
        this.questionType = questionType;
        this.options = options;
        this.contentAnswer = contentAnswer;
        this.score = score;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.knowledgePoint = knowledgePoint;
        this.subject = subject;
    }

}
